#include "DynAddDlg.h"

// Standard construction sequence
CModalDialog* CModalDialog::NewL()
    {
    CModalDialog* self = CModalDialog::NewLC();
    CleanupStack::Pop(self);
    return self;
    }

CModalDialog* CModalDialog::NewLC()
    {
    CModalDialog* self = new (ELeave) CModalDialog;
    CleanupStack::PushL(self);
    self->ConstructL();
    return self;
    }

void CModalDialog::ConstructL()
    {
	// no implementation required
	TRect rect = TRect(0,0,100,100);//iAvkonViewAppUi->View( TUid::Uid( EITestPageContainerViewId ) )->ClientRect();	
//	SetExtent( TPoint( 0, 0 ), TSize( rect.Width(), rect.Height() ) );	
//	SetSizeAndPosition (TSize( rect.Width(), rect.Height()));
    }

void CModalDialog::PreLayoutDynInitL()
	{
	_LIT(KMyText, "The mobile phone market will flourish when software for phones flourishes");
	const TInt KMyId = 1; // Any arbitary value
	CCoeControl* control = CreateLineByTypeL(KNullDesC, KMyId, EEikCtEdwin, NULL);
	iEdwin = static_cast<CEikEdwin*>(control);
	iEdwin->ConstructL( EEikEdwinNoHorizScrolling | EEikEdwinNoAutoSelection | EEikEdwinResizable, 20, 100, 10 );
	iEdwin->CreateTextViewL();
	iEdwin->SetTextL(&KMyText);
	}


void CModalDialog::PostLayoutDynInitL()
	{
	TRect rect = Rect();
	iEdwin->SetRect(rect);
	}

void CModalDialog::SetSizeAndPosition(const TSize &  aSize)
{
	TRect rect = TRect(0,0,100,100);//iAvkonViewAppUi->View( TUid::Uid( EITestPageContainerViewId ) )->ClientRect();	
	SetExtent( TPoint( 0, 0 ), TSize( rect.Width(), rect.Height() ) );	
}

// Constructor
CModalDialog::CModalDialog()
    {
	// no implementation required
    }

// Destructor
CModalDialog::~CModalDialog()
    {
    // no implementation required
    }

